<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>自动生成</title>
<script language="javascript" type="text/javascript"
	src="<{$siteurl.joe.url}>/ui/default/js/jquery.min.js"></script>
<style type="text/css">
.addressmC3v3 a {
	background-color: #f31d45;
	border-radius: 2px;
	color: #fff;
	display: block;
	font-size: 20px;
	height: 50px;
	line-height: 50px;
	text-align: center;
	width: 150px;
}

select {
	position: relative;
	left: -2px;
	top: -2px;
	font-size: 20px;
	width: 283px;
	line-height: 14px;
	bo rder: 0px;
	color: #909993;
}
</style>
<script type="text/javascript">
	function creat(falg) {
		var table_name = $('#table_name').val();
		if(table_name == '' || table_name == null){
			alert('请选择操作的表格');
		}else{
			$.ajax({
				type : 'post',
				url : '/readtabletofun/createAjax',
				data : {
					name : table_name,
					falg : falg
				},
				dataType : 'json',
				success : function(data) {
					if(data == 1){
						alert("失败,生成有误!!!");
					}else if(data == 2){
						alert("失败,请重新生成!!!");
					}else if(data == 3){
						alert("失败,已经生成!!!");
					}else if(data == 0){
						alert("成功,生成成功");
					}
				}
			});
		}
	}
</script>
</head>
<body>
	<select class="addressC3v2sel w108" id='table_name'>
		<option value="">选择要操作的表格</option> <{foreach from=$table item=v}>
		<option value="<{$v.Tables_in_joe_db}>"><{$v.Tables_in_joe_db}></option>
		<{/foreach}>
	</select>

	<p class="addressmC3v3">
		<a href="javascript:void(0)" onclick="creat('1')">生成操作类</a>
	</p>
	<p class="addressmC3v3">
		<a href="javascript:void(0)" onclick="creat('2')">生成表对象</a>
	</p>
	</body>
</html>

